<template>
  <el-date-picker v-model="innerValue" type="datetime" placeholder="选择日期时间"></el-date-picker>
</template>
<script>
  var moment = require('moment');


  export default {
    props: ["value","temp"],
    components: {},
    data() {
      return {
        loading: false,
        innerValue: '',
        deviceList: [],
      }

    },
    mounted() {
      console.log('this',this.temp);
    },
    methods: {},
    watch: {
      value(v) {
        console.log("watch",v)
        this.innerValue = v;
      },
      innerValue(v) {
        if(v !== '' && v !== undefined && v !== null) {
          console.log('innerValue_v', v);

          var m = moment(v).format("YYYY-MM-DD HH:mm:ss");

          console.log('innerValue_m',m);


          this.$emit("input", m);

          this.$emit('change', v)

        }
      }
    }

  }
</script>
